package com.bgIntlgn.client.entity.manufacture.picLibrary;

import yuhuibear.poat.annotations.relation.View;
import yuhuibear.poat.object.bean.Bean;

/**
 * 厂长有：表示图纸的流转位置在厂长，以及下属处
 * 
 * @author Simon Chen
 * 
 */

@View(name = "factory_has", sqlToCreate = "select factoryhas.pic_paper_id as pic_paper_id, factoryhas.quantity as totalquantity, (factoryhas.quantity-departmenthas.quantity) as factquantity, dic.name as type "
		+ "from ((select ppcl.pic_paper_id as pic_paper_id, sum(ppcl.quantity) as quantity from pic_papaer_circulate_librarys as ppcl where ppcl.place = 0 group by ppcl.pic_paper_id having sum(ppcl.quantity)>0) as factoryhas left outer join "
		+ "(select ppcl.pic_paper_id as pic_paper_id, sum(ppcl.quantity) as quantity from pic_papaer_circulate_librarys as ppcl where ppcl.place = 1 or ppcl.place = 3 group by ppcl.pic_paper_id) as departmenthas "
		+ " on departmenthas.pic_paper_id = factoryhas.pic_paper_id), pic_papers as pp, dictionarys as dic where pp.id=factoryhas.pic_paper_id  and pp.type=dic.id;")
public class FactoryHas implements Bean {

	private String picPaperId;
	// 图纸类型
	private String type;
	// 图纸总数
	private Long totalquantity;
	// 实际有的（部分借给了部长）
	private Long factquantity;

	public String getPicPaperId() {
		return picPaperId;
	}

	public void setPicPaperId(String picPaperId) {
		this.picPaperId = picPaperId;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Long getTotalquantity() {
		return totalquantity;
	}

	public void setTotalquantity(Long totalquantity) {
		this.totalquantity = totalquantity;
	}

	public Long getFactquantity() {
		return factquantity;
	}

	public void setFactquantity(Long factquantity) {
		this.factquantity = factquantity;
	}
}
